/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package es.unavarra.iws.routerinstall.gui;

import es.unavarra.iws.routerinstall.engine.QueryManager;
import java.awt.Color;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;
import javax.swing.Timer;

/**
 *
 * @author aqm
 */
public class AcercaDe extends javax.swing.JPanel {
    QueryManager qm = null;
    private int alpha = 255;  
    private int increment = -5;     
    /**
     * Creates new form Menu
     */
    public AcercaDe(QueryManager qm) {
        this.qm = qm;
        initComponents();
        new Timer(40, new ActionListener() {  
            public void actionPerformed(ActionEvent e) {  
                alpha += increment;  
                if (alpha >= 255) {  
                    alpha = 255;  
                    increment = -increment;  
                }  
                if (alpha <= 0) {  
                    alpha = 0;  
                    increment = -increment;  
                    Random r = new Random();
                    int n = (r.nextInt(4)+1);
                    if(n==1){jlMariela.setText("Mariela");jlItziar.setText("Itziar");jlMikel.setText("Mikel");jlArnulfo.setText("Arnulfo");}
                    if(n==2){jlMariela.setText("Itziar");jlItziar.setText("Mikel");jlMikel.setText("Arnulfo");jlArnulfo.setText("Mariela");}
                    if(n==3){jlMariela.setText("Mikel");jlItziar.setText("Arnulfo");jlMikel.setText("Mariela");jlArnulfo.setText("Itziar");}
                    if(n==4){jlMariela.setText("Arnulfo");jlItziar.setText("Mariela");jlMikel.setText("Itziar");jlArnulfo.setText("Mikel");}
                }
                jlMariela.setForeground(new Color(0, 0, 0, alpha));  
                jlItziar.setForeground(new Color(0, 0, 0, alpha));  
                jlMikel.setForeground(new Color(0, 0, 0, alpha));  
                jlArnulfo.setForeground(new Color(0, 0, 0, alpha));  
                }  
            }).start();  
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jlIcono = new javax.swing.JLabel();
        jlTitulo = new javax.swing.JLabel();
        jbHome = new javax.swing.JButton();
        jlBarra = new javax.swing.JLabel();
        jlUPNA = new javax.swing.JLabel();
        jlArnulfo = new javax.swing.JLabel();
        jlMariela = new javax.swing.JLabel();
        jlItziar = new javax.swing.JLabel();
        jlMikel = new javax.swing.JLabel();
        jlIWS = new javax.swing.JLabel();
        jlMUTI = new javax.swing.JLabel();
        jlBackground = new javax.swing.JLabel();

        setLayout(null);

        jlIcono.setIcon(new javax.swing.ImageIcon(getClass().getResource("/es/unavarra/iws/routerinstall/resources/img/addressbook32.png"))); // NOI18N
        add(jlIcono);
        jlIcono.setBounds(35, 30, 30, 30);

        jlTitulo.setFont(new java.awt.Font("Verdana", 0, 24)); // NOI18N
        jlTitulo.setForeground(new java.awt.Color(255, 255, 255));
        jlTitulo.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jlTitulo.setText("Acerca de");
        add(jlTitulo);
        jlTitulo.setBounds(100, 20, 150, 50);

        jbHome.setIcon(new javax.swing.ImageIcon(getClass().getResource("/es/unavarra/iws/routerinstall/resources/img/home32.png"))); // NOI18N
        jbHome.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jbHomeMouseClicked(evt);
            }
        });
        add(jbHome);
        jbHome.setBounds(420, 20, 50, 50);

        jlBarra.setIcon(new javax.swing.ImageIcon(getClass().getResource("/es/unavarra/iws/routerinstall/resources/img/w70.png"))); // NOI18N
        add(jlBarra);
        jlBarra.setBounds(0, 20, 600, 50);

        jlUPNA.setIcon(new javax.swing.ImageIcon(getClass().getResource("/es/unavarra/iws/routerinstall/resources/img/upna2.png"))); // NOI18N
        add(jlUPNA);
        jlUPNA.setBounds(170, 270, 180, 100);

        jlArnulfo.setFont(new java.awt.Font("Arial", 0, 28)); // NOI18N
        jlArnulfo.setText("Arnulfo");
        add(jlArnulfo);
        jlArnulfo.setBounds(270, 370, 120, 33);

        jlMariela.setFont(new java.awt.Font("Arial", 0, 28)); // NOI18N
        jlMariela.setText("Mariela");
        add(jlMariela);
        jlMariela.setBounds(120, 230, 120, 33);

        jlItziar.setFont(new java.awt.Font("Arial", 0, 28)); // NOI18N
        jlItziar.setText("Itziar");
        add(jlItziar);
        jlItziar.setBounds(270, 230, 110, 33);

        jlMikel.setFont(new java.awt.Font("Arial", 0, 28)); // NOI18N
        jlMikel.setText("Mikel");
        add(jlMikel);
        jlMikel.setBounds(120, 370, 100, 33);

        jlIWS.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        jlIWS.setForeground(new java.awt.Color(255, 204, 0));
        jlIWS.setText("Introducción a la Web Semántica - 2012");
        add(jlIWS);
        jlIWS.setBounds(140, 500, 230, 15);

        jlMUTI.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
        jlMUTI.setForeground(new java.awt.Color(255, 255, 102));
        jlMUTI.setText("Máster Universitario en Tecnologías Informáticas");
        add(jlMUTI);
        jlMUTI.setBounds(90, 480, 310, 17);

        jlBackground.setIcon(new javax.swing.ImageIcon(getClass().getResource("/es/unavarra/iws/routerinstall/resources/img/swr1.png"))); // NOI18N
        add(jlBackground);
        jlBackground.setBounds(0, 0, 480, 660);
    }// </editor-fold>//GEN-END:initComponents

    private void jbHomeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbHomeMouseClicked
        // TODO add your handling code here:
        this.setVisible(false);
        Container menu = this.getFocusCycleRootAncestor();
        Menu principal = new Menu(qm);
        menu.remove(this);
        principal.setSize(menu.getSize());
        menu.add(principal, 0);        
    }//GEN-LAST:event_jbHomeMouseClicked

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jbHome;
    private javax.swing.JLabel jlArnulfo;
    private javax.swing.JLabel jlBackground;
    private javax.swing.JLabel jlBarra;
    private javax.swing.JLabel jlIWS;
    private javax.swing.JLabel jlIcono;
    private javax.swing.JLabel jlItziar;
    private javax.swing.JLabel jlMUTI;
    private javax.swing.JLabel jlMariela;
    private javax.swing.JLabel jlMikel;
    private javax.swing.JLabel jlTitulo;
    private javax.swing.JLabel jlUPNA;
    // End of variables declaration//GEN-END:variables
}
